#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author:Charles.chen
# createDate:2017/9/22
# Title:
# Tip:
from __future__ import division
from app.model import SensorData
from app.toolkit import commonUtil
from app.system.systemService import getSystemConfigList
import os

# 根据开始时间和结束时间筛选数据
def downLoadSensorDataBetweenDate(startDate=None, endDate=None):
    return SensorData.select().where(SensorData.created_time >= startDate and SensorData.created_time <= endDate).execute()

# 获取配置文件列表
def getIotXConfigList(path=None):
    path = "backups/dataFiles"
    fileNames = commonUtil.getIotXConfigList(path)
    return fileNames
    pass

# 获取微尘配置文件列表
def getDustConfigList():
    baseDir = ""
    getSystemConfigList(baseDir)
    pass